package edu.scnu.fans.fingertip.user.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import edu.scnu.fans.fingertip.user.model.UserAddress;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Update;

public interface UserAddressMapper extends BaseMapper<UserAddress> {

    /**
     * 将原来的默认地址更新为非默认
     */
    @Update("update fingertip_user.user_address set default_address = 0 where user_id = #{userId} and default_address = 1")
    int setUnDefaultByUserId(@Param("userId") Long userId);
}
